#!/usr/bin/env python
import os
import sys
import django

# 设置Django环境
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'inter_api.settings')
django.setup()

from django.contrib.auth import get_user_model

User = get_user_model()

def reset_password():
    try:
        user = User.objects.get(username='zhangsan2024')
        user.set_password('testpass123')
        user.save()
        print(f"密码已重置为 'testpass123'")
    except User.DoesNotExist:
        print("用户不存在")

if __name__ == '__main__':
    reset_password()